package com.darly.std.business.store;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Display;
import android.view.Gravity;
import android.view.WindowManager;

import com.darly.rnmodule.component.store.StoreComponent;

/**
 * Description TODO:
 * Package com.darly.std.business.store
 * Author fronchdarly
 * Date 2021/5/27 3:15 PM
 * Where: 陕西西安
 * How: 特别一般的公司
 */
public class StoreDialog extends Dialog {

        public StoreDialog(Context context) {
            super(context);

        }

        @SuppressWarnings("deprecation")
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(new StoreComponent(getContext()));
            getWindow().setBackgroundDrawable(null);
            getWindow().setGravity(Gravity.BOTTOM);//设置显示在底部
            setCanceledOnTouchOutside(true);
            WindowManager windowManager=getWindow().getWindowManager();
            Display display= windowManager.getDefaultDisplay();
            WindowManager.LayoutParams layoutParams=getWindow().getAttributes();
            layoutParams.width=display.getWidth();//设置Dialog的宽度为屏幕宽度
            layoutParams.height=display.getHeight();
            getWindow().setAttributes(layoutParams);
        }

}
